package com.blustreaksw.cyclecoach.main;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

import com.blustreaksw.cyclecoach.R;
import com.blustreaksw.cyclecoach.btle.ScanningActivity;
import com.blustreaksw.cyclecoach.history.WorkoutHistoryActivity;

public class MainActivity extends Activity {
	
	private Button mHistoryButton;
	private Button mSettingsButton;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		getActionBar().setDisplayHomeAsUpEnabled(true);
        //setHasOptionsMenu(true);
		
		mHistoryButton = (Button)findViewById(R.id.startButton);
		mHistoryButton.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent i = new Intent(MainActivity.this, WorkoutHistoryActivity.class);
				startActivity(i);
				
			}
		});
		
		mSettingsButton = (Button)findViewById(R.id.settingsButton);
		mSettingsButton.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent i = new Intent(MainActivity.this, ScanningActivity.class);
				startActivity(i);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		
		return true;
	}

}
